package service

import (
	"echo-utils/internal/model"

	_ "github.com/mattn/go-sqlite3"
	"xorm.io/xorm"
)

type DB struct {
	engine *xorm.Engine
}

func (d *DB) Sync() error {
	return d.engine.Sync(new(model.Article), new(model.Tags), new(model.Setting), new(model.Ilog))
}

func NewDB(eg *xorm.Engine) *DB {
	return &DB{
		engine: eg,
	}
}
